package com.naiterui.ehp.bp.domain;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class PatientPersonDoctorPK implements java.io.Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 患者id
     */
    @Column(name = "patient_id")
    private Long patientId;

    /**
     * 医生id
     */
    @Column(name = "doctor_id")
    private Long doctorId;

    public PatientPersonDoctorPK() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }

        PatientPersonDoctorPK that = (PatientPersonDoctorPK) o;

        if (!patientId.equals(that.patientId)) {
            return false;
        }
        return doctorId.equals(that.doctorId);
    }

    @Override
    public int hashCode() {
        int result = patientId.hashCode();
        result = 31 * result + doctorId.hashCode();
        return result;
    }

    public PatientPersonDoctorPK(Long patientId, Long doctorId) {
        this.patientId = patientId;
        this.doctorId = doctorId;
    }

    public Long getPatientId() {
        return patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public Long getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(Long doctorId) {
        this.doctorId = doctorId;
    }

    @Override
    public String toString() {
        return "PatientPersonDoctorPK{" +
                "patientId=" + patientId +
                ", doctorId=" + doctorId +
                '}';
    }
}
